FROM java:8
MAINTAINER LONhtyGKUI
#添加jdk包和设置时区   mvn package -Dmaven.test.skip=true
RUN mkdir -p /usr/java && echo "Asia/Shanghai" > /etc/timezone
#安装JDK
# 准备 JDK/Tomcat 系统变量与路径
ENV LANG en_US.UTF-8
ENV JAVA_HOME=/usr/java/latest
ENV PATH=$PATH:$JAVA_HOME/bin
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
RUN echo $JAVA_HOME

WORKDIR /data
ADD target/FILE_NAME.jar FILE_NAME-PORT.jar
#ADD https://microservice-oss.oss-cn-hangzhou.aliyuncs.com/plugins/skywalking-agent.tar.gz .
#RUN tar -zxvf skywalking-agent.tar.gz && rm -rf skywalking-agent.tar.gz
ENV springConfig="--spring.profiles.active=PROFILE"
ENV targetFile=cloud-demo.jar
ENV JVM_OPTS="-XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=80.0"
ENV SKY_CONFIG=" "
CMD ["sh","-c","java -Djava.security.egd=file:/dev/./urandom $JVM_OPTS $SKY_CONFIG -jar $targetFile $springConfig"]
